package org.extremengine.shape;

/**
 * TODO?删除？
 * @author yuxing
 * @deprecated
 */
public class ShapeUtils {

	/**
	 * Whether point (x.y) in the circle.
	 * @param x
	 * @param y
	 * @param c
	 * @return
	 * @deprecated to {@link Circle}
	 */
	public static boolean pointInCircle(double x, double y, Circle c) {
		double cx = c.getHeart().getX();
		double cy = c.getHeart().getY();
		if (Math.sqrt((cx - x) * (cx - x) + (cy - y) * (cy - y)) <= c.getRadius()) {
			return true;
		}
		return false;
	}
	
	/**
	 * Whether 2 coordinate ranges overlap. 
	 * @param start1
	 * @param end1
	 * @param start2
	 * @param end2
	 * @return
	 * @deprecated To {@link ParallelRectangle}.projectionOverlap
	 */
	public static boolean coordinateRangeOverlap(double start1, double end1, double start2, double end2) {
		if (start2 > start1 && start2 < end1 
				|| end2 > start1 && end2 < end1) {
			return true;
		}
		return false;
	}

//	public static boolean circleCutHorizontalLine(Circle c, double liney) {
//		if ((c.getHeart().getY() + c.getRadius()) > liney || (c.getHeart().getY() - c.getRadius()) < liney) {
//			return true;
//		}
//		return false;
//	}
//
//	public static boolean circleCutVerticalLine(Circle c, double linex) {
//		if ((c.getHeart().getX() + c.getRadius()) > linex || (c.getHeart().getX() - c.getRadius()) < linex) {
//			return true;
//		}
//		return false;
//	}
}
